package com.yilin.tms.core.remote;

import com.yilin.tms.core.application.ReturnData;
import com.yilin.tms.core.components.interceptor.ReqProviderInterceptor;
import com.yilin.tms.core.entity.system.param.*;
import com.yilin.tms.core.entity.system.system.FunctionApi;
import com.yilin.tms.core.entity.system.system.Jurisdiction;
import com.yilin.tms.core.entity.system.system.Menu;
import com.yilin.tms.core.entity.system.system.MenuOperate;
import com.yilin.tms.core.entity.user.UserType;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 远程调用 系统服务
 *
 * @author zhangjinyuan
 * @date 2022/10/30
 */
@FeignClient(name = "system-service-provider", configuration = ReqProviderInterceptor.class)
public interface ISystemRemote {

    /**
     * 获取节点List
     */
    @PostMapping(value = "/system/functionApi/getAllFunctionApiList")
    ReturnData<List<FunctionApi>> getAllFunctionApiList();
    /**
     * 通过IDS集合获取功能集合
     * */
    @PostMapping(value = "/system/functionApi/getFunctionApiListByCodes")
    ReturnData<List<FunctionApi>> getFunctionApiListByCodes(@RequestParam(value = "apiCodes") String apiCodes);


    //------------------------------------------------------------------------------------------------------------------

    /**
     * 获取节点List
     */
    @PostMapping(value = "/system/menu/getAllMenuList")
    ReturnData<List<Menu>> getAllMenuList();
    /**
     * 通过IDS集合获取菜单集合
     * */
    @PostMapping(value = "/system/menu/getMenuListByCodes")
    ReturnData<List<Menu>> getMenuListByCodes(@RequestParam(value = "menuCodes")String menuCodes);
    /**
     * 通过IDS集合获取菜单集合
     * 角色：获取只属于自己的菜单
     * */
    @PostMapping(value = "/system/menu/getMenuListByUserTypeAndCodes")
    ReturnData<List<Menu>> getMenuListByUserTypeAndCodes(@RequestParam(value = "userType") UserType userType,
                                                         @RequestParam(value = "menuCodes")String menuCodes);
    /**
     * 查询操作
     * */
    @PostMapping(value = "/system/menu/getMenuOperateListByMenuCodes")
    ReturnData<Map<String, ArrayList<MenuOperate>>> getMenuOperateListByMenuCodes(@RequestParam(value = "menuCodes")String menuCodes);
    /**
     * 查询操作
     * */
    @PostMapping(value = "/system/menu/getMenuOperateListMapByCodes")
    ReturnData<Map<String, ArrayList<MenuOperate>>> getMenuOperateListMapByCodes(
            @RequestParam(value = "menuCodeOperateCodesJson") String menuCodeOperateCodesJson);


    //------------------------------------------------------------------------------------------------------------------

    /**
     * 获取计价车辆类型
     */
    @PostMapping(value = "/system/param/getPricingCommTruckTypeList")
    ReturnData<List<CommTruckType>> getPricingCommTruckTypeList();

    /**
     * 根据ID获取公共车辆类型
     */
    @PostMapping("/system/param/getCommTruckTypeById")
    ReturnData<CommTruckType> getCommTruckTypeById(@RequestParam("commTruckTypeId") String commTruckTypeId);
    /**
     * 根据能源ID获取
     */
    @PostMapping("/system/param/getTruckEnergyById")
    ReturnData<TruckEnergyType> getTruckEnergyById(@RequestParam("truckEnergyTypeId") String truckEnergyTypeId);
    /**
     * 根据车辆ID获取车辆类型
     */
    @PostMapping("/system/param/getTruckTypeById")
    ReturnData<TruckType> getTruckTypeById(@RequestParam("truckTypeId") String truckTypeId);
    /**
     * 根据id获取车牌类型
     */
    @PostMapping("/system/param/getTruckPlateById")
    ReturnData<TruckPlate> getTruckPlateById(@RequestParam("truckPlateId") String truckPlateId);

    /**
     * 根据ID数组获取公共车辆类型
     */
    @PostMapping("/system/param/getCommTruckTypeListByIds")
    ReturnData<List<CommTruckType>> getCommTruckTypeListByIds(@RequestParam("commTruckTypeIds") String[] commTruckTypeIds);

    /**
     * 根据id获取货物类型
     */
    @PostMapping("/system/param/getGoodsTypeById")
    ReturnData<GoodsType> getGoodsTypeById(@RequestParam("goodsTypeId") String goodsTypeId);

    /**
     * 根据code获取货物类型
     */
    @PostMapping("/system/param/getGoodsTypeByCode")
    ReturnData<List<GoodsType>> getGoodsTypeByCode(@RequestParam("goodsTypeCode") String goodsTypeCode);

    /**
     * 通过车辆名称检索车辆类型
     */
    @PostMapping("/system/param/queryTruckTypeByName")
    ReturnData<List<TruckType>> queryTruckTypeByName(@RequestParam("name") String name);

    /**
     * 通过能源名称检索能源类型
     */
    @PostMapping("/system/param/queryTruckEnergyTypeByName")
    ReturnData<TruckEnergyType> queryTruckEnergyTypeByName(@RequestParam("name") String name);

    /**
     * 通过车牌名称获取车牌类型
     */
    @PostMapping("/system/param/queryTruckPlateByName")
    ReturnData<TruckPlate> queryTruckPlateByName(@RequestParam("name") String name);

    /**
     * 通过车牌名称获取车牌类型
     */
    @PostMapping("/system/jurisdiction/getJurisdictionListByIds")
    ReturnData<List<Jurisdiction>> getJurisdictionListByIds(@RequestParam("jurisdictionIds") String jurisdictionIds);

}
